package com.qms.tubu.dialog;

import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.support.v4.content.res.ResourcesCompat;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.PopupWindow;

import com.qms.tubu.R;

/**
 * Created by Mad on 2015/7/28.
 */
public class ExPopupWindow extends PopupWindow {
    public ExPopupWindow(View contentView) {
        super(contentView, WindowManager.LayoutParams.MATCH_PARENT,WindowManager.LayoutParams.WRAP_CONTENT,true);
        this.setTouchable(true);
        this.setBackgroundDrawable(ResourcesCompat.getDrawable(contentView.getResources(), R.drawable.popup_background,null));
        this.setOutsideTouchable(true);
       // contentView.setOnKeyListener(this);

    }
//
//    @Override
//    public boolean onKey(View v, int keyCode, KeyEvent event) {
//        if(keyCode==KeyEvent.KEYCODE_BACK) {
//            this.dismiss();
//            return true;
//        }
//        return false;
//    }
}
